import axios from "@/utils/axios";

export default {
    // 获取学生列表
    getChildren(params) {
        return axios.get('/children/getChildren', {
            params: params
        });
    },
    // 获取设置的幼儿园班级
    getSetSchoolAndGroup() {
        return axios.get('/children/getSetSchoolAndGroup');
    },
    // 创建新的学生
    createChild(child) {
        return axios.post('/children', child);
    },
    // 获取单个学生信息
    getChild(childId) {
        return axios.get('/children', {
            params: {
                childId: childId,
            }
        });
    },
    // 更新学生信息
    updateChild(child) {
        return axios.put('/children', child);
    },
    // 将学生离校
    inactiveChild(childId) {
        return axios.post('/children/inactive',  {
            childId: childId,
        });
    },
    // 删除学生
    deleteChild(childId) {
        return axios.delete('/children/' + childId);
    },
    // 还原inactive的学生
    restoreChild(childId) {
        return axios.post('/children/restore', {
            childId: childId,
        });
    },
    // 还原inactive的学生
    getParentChildren(parentId) {
        return axios.get('/children/getParentChildren', {
            params: {
                parentId: parentId,
            }
        });
    },

}
